local guidao = fk.CreateSkill {

  name = "joyex__guidao",

  tags = {  },

}



guidao:addEffect(fk.AskForRetrial, {
  name = "joyex__guidao",
  anim_type = "control",
  events = {fk.AskForRetrial},
  can_trigger = function(self, event, target, player, data)
    return player:hasSkill(guidao.name) and not player:isNude()
  end,
  on_cost = function(self, event, target, player, data)
    local card = player.room:askForResponse(player, guidao.name, ".|.|spade,club|hand,equip", "#joyex__guidao-ask::" .. target.id..":"..data.reason, true)
    if card ~= nil then
      event:setCostData(self, card)
      return true
    end
  end,
  on_use = function(self, event, target, player, data)
    player.room:retrial(event:getCostData(self), player, data, guidao.name, true)
    if not player.dead and event:getCostData(self).suit == Card.Spade and event:getCostData(self).number > 1 and event:getCostData(self).number < 10 then
      player:drawCards(1, guidao.name)
    end
  end,
})

return guidao